package com.gaoding.qa.auto.condition;

import com.dtflys.forest.callback.SuccessWhen;
import com.dtflys.forest.http.ForestRequest;
import com.dtflys.forest.http.ForestResponse;
import com.gaoding.qa.auto.help.TestHelper;

/**
 * 成功函数
 * @author mobai
 * @since 2021/10/16 11:22
 */
public class SuccessCondition implements SuccessWhen {
    @Override
    public boolean successWhen(ForestRequest forestRequest, ForestResponse forestResponse) {
        return forestResponse.noException()
                && forestResponse.getStatusCode() == TestHelper.getContext().getStatus();
    }
}
